<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/inc::header"/>
<body>
<table class="layui-table" id="grid" lay-filter="grid">
</table>
<script th:replace="/common/inc::incJs"></script>
<script>
    var tableIns;

    $(function () {
        tableIns = createTable({
            url: '/backend/security/customerCommissionLog/commissionLogList',
            cols: [[
                {field: 'billId', title: '提现订单编号', width: 150}
                , {
                    field: 'changedBalance',
                    title: '变动金额',
                    width: 150
                }, {
                    field: 'type',
                    title: '类型',
                    width: 150,
                    templet: "#typetmp"
                }, {
                    field: 'status',
                    title: '状态',
                    width: 150,
                    templet: "#statusTpl"
                }
            ]]
        })
    });

    layui.table.on('tool(grid)', function (obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
        var data = obj.data; //获得当前行数据
        var layEvent = obj.event; //获得 lay-event 对应的值
        var tr = obj.tr; //获得当前行 tr 的DOM对象02\
        if (layEvent === 'logInfo') { //编辑
            openDialog({
                url: "/backend/security/commission/logInfo?id=" + data.id
            });
        }
    });


    layui.form.on('submit(searchBtn)', function (data) {
        tableIns.reload({
            where: data.field
        });
        return false;
    });
</script>
<script type="text/html" id="typetmp">
    {{#  if(d.status ===1){ }}
    <span>提现</span>
    {{#  } else { }}
    <span>开通会员佣金结算</span>
    {{#  } }}
</script>
<script type="text/html" id="statusTpl">
    {{#  if(d.status ===2){ }}
    <span style="color: #FF0000;">未通过</span>
    {{#  } else  if(d.status ===1){ }}
    <span style="color: green;">已处理</span>
    {{#  } else  if(d.status ===0){ }}
    <span>未处理</span>
    {{#  } }}
</script>
</body>
</html>
